<?php $this->headLink()->appendStylesheet($this->js('plugins/cluetip/jquery.cluetip.css'));
$this->headScript()->appendFile($this->js('plugins/cluetip/jquery.cluetip.js'))?>
<style>
.error {border: #faa solid thin; padding:5px; font-size:12px}
.error tbody{white-space: nowrap;}
.error caption {font-size: 1.5em; }
.itemError{color:red; font-weight:bold; border:#f55 solid thin;}
.okData {border: #00f solid thin; padding:5px;}
</style>
<script>
$(function(){
	$('td[title]').css({borderBottom: '1px solid #900'}).cluetip({
		  splitTitle: '|',
		  arrows: true,
		  dropShadow: false,
		  cluetipClass: 'jtip'}
		);

    <?php if($this->error):?>
    alert("<?php echo $this->translate('import data has error format')?>");
    <?php endif?>

});
</script>
<div class="ui-widget">
<table>
<tr>
<td style="vertical-align: top">
<?php if ($this->errorMessage):?>
<div class="ui-state-error ui-corner-all" style="padding: 0pt 0.7em;">
                    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: 0.3em;"></span>
                    <strong>Alert:</strong> <?php echo $this->translate('item order error')?></p>
</div>
<?php endif?>
<?php echo $this->form?>
</td>
<td>
<div style="border:#ccc solid thin; padding:5px; margin:10px">
<h2>學生資料批次建檔說明</h2>
<ul style="list-style: decimal">
<li>本程式只能建立學生基本資料，其他如學生戶口資料等，需至學籍管理程式建立。</li>
<li>利用 excel 或其他工具鍵入學生資料，存成 csv 檔，並保留第一列標題檔，如 <a href="<?php echo $this->route('demo')?>">範例檔</a></li>
<li>出生日期以西元為準。</li>
<li>地址順序:按下列方式排列，程式才可正常拆解。<br/>
縣 (市)鄉(鎮區)村(里)鄰路 (街)段巷弄號之樓之 <br />
例:
<ul>
<li>台中縣外埔鄉中山村11鄰中山路34之6號</li>
<li>台中縣外埔鄉大同村甲后路9號</li>
</ul>
</li>
</ul>

</div>
</td>
</tr>
</table>
<?php if ($this->error):?>
<div class="error">
<table>
<caption><?php echo  $this->translate('error title')?></caption>
<thead>
<tr>
<?php foreach ($this->titleArr as $row):?>
<th><?php echo $row?></th>
<?php endforeach?>
</tr>
</thead>
<?php foreach ($this->error as $key=>$val):?>
<tr>
<?php foreach($this->oldData[$key] as $itemId=>$row):?>
<td <?php if (isset($val[$itemId])):?>title="<?php echo $this->translate('error title')?>|<?php echo $this->translate($val[$itemId])?>" class="itemError"<?php endif?>>
<?php echo $row?>
</td>
<?php endforeach?>
</tr>
<?php endforeach;?>
</table>
</div>
<?php endif?>
<?php if ($this->okData):?>
<div class="okData">
<h2><?php echo sprintf($this->translate('%d rows import sucessed'),count($this->okData))?></h2>
<ul>
<?php foreach($this->okData as $row):?>
<li><?php echo $row[0].'-'.$row[1].' '.$this->translate('import success')?></li>
<?php endforeach?>
</ul>
</div>
<?php endif;?>
</div>